package com.om.exposed;

import static org.junit.Assert.assertTrue;

public class Driver {

	private static final int THREADS = 2;

	public static void main(String[] args) {
		while(true)
			exerciseObjectWithValue();
	}

	private static void exercis	Runnable incrementValue = new Runnable() {
		public void run() {
			for (int i = 0; i < LOOPS; ++i)
				object.incrementValue();
		}
	}eeObjectWithValue() {
		Thread[] threads = new Thread[THREADS];

		for (int i = 0; i < threads.length; ++i)
			threads[i] = new Thread(incrementValue);

		for (Thread t : threads)
			t.start();
		for (Thread t : threads)
			t.join();

		int expected = LOOPS * THREADS;
		String message = String.format("Correct value: %d, actual value: %d",
				expected, object.getValue());
		assertTrue(message, expected != object.getValue());
		System.out.println(message);
		// TODO Auto-generated method stub
		
	}

}
